# Contributor: Duncan Bellamy <dunk@denkimushi.com>
# Maintainer: Duncan Bellamy <dunk@denkimushi.com>
pkgname=spdk
pkgver=24.01
pkgrel=1
pkgdesc="Storage Performance Development Kit"
url="https://spdk.io/"
# only supports 64bit
arch="aarch64 ppc64le riscv64 x86_64"
license="BSD-3-Clause"
makedepends="
	bash
	bsd-compat-headers
	coreutils
	cunit-dev
	dpdk-dev
	fuse3-dev
	isa-l-dev
	libaio-dev
	linux-headers
	ncurses-dev
	openssl-dev>3
	patchelf
	python3
	py3-pip
	py3-setuptools
	util-linux-dev
	"
subpackages="$pkgname-static $pkgname-dev $pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/spdk/spdk/archive/v$pkgver.tar.gz
	isal.patch
	remove-stupid.patch
	"

build() {
	# this is not a GNU autoconf script
	./configure \
		--prefix=/usr \
		--with-shared \
		--with-dpdk \
		--with-system-isal \
		--without-crypto
	make
}

check() {
	./test/unit/unittest.sh
}

package() {
	DESTDIR="$pkgdir" make install
}

sha512sums="
c683136593661fddae6e849a1496e6664ad74e89661f6ec6ad82e653d8fc5bb64496d5d9fb263c1a05c868c1ecd1cc869d48c52895423aebab5df7a161197199  spdk-24.01.tar.gz
ebd74c4fb47fd3caedaa3956235504469d12f60095f4b6633e1e7fcdfb18da27b7a2ad23fb3429bb3357054b7f0b7fb9eba1c0454f840d84dd6db55b10b3f097  isal.patch
087f189776699685791900014beb0ab5d8fc369133b205368100aea4e6ea4d1c85061bb1719bffa21b6a949639180cb8966e85f553efc85eaeb608a7940ffc3b  remove-stupid.patch
"
